
package GUI;

import javax.swing.JFormattedTextField;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

/**
 *
 * @author Isaac
 */
public class JanelaLogin extends javax.swing.JFrame {

    /** Creates new form JanelaLogin */
    String teste = "teste";
    private ControladorLogin ctrlLogin = new ControladorLogin();

    public void setCtrlLogin(ControladorLogin ctrlLogin) {
        this.ctrlLogin = ctrlLogin;
        botaoCadastrar.addActionListener(ctrlLogin);
        botaoEntrar.addActionListener(ctrlLogin);
    }

    public String getCampoSenha() {
        return CampoSenha.getName();
    }

    public void setCampoSenha(String CampoSenha) {
        this.CampoSenha.setText(CampoSenha);
    }

    public String getCampoCpf() {
        return campoCpf.getText();
    }

    public void setCampoCpf(String campoCpf) {
        this.campoCpf.setText(campoCpf);
    }

    public String getCampoLoginNaoCadastrado() {
        return campoLoginNaoCadastrado.getText();
    }

    public void setCampoLoginNaoCadastrado(String campoLoginNaoCadastrado) {
        this.campoLoginNaoCadastrado.setText(campoLoginNaoCadastrado);
    }

    public String getCampoSenhaNaoCadastrado() {
        return campoSenhaNaoCadastrado.getName();
    }

    public void setCampoSenhaNaoCadastrado(String campoSenhaNaoCadastrado) {
        this.campoSenhaNaoCadastrado.setText(campoSenhaNaoCadastrado);
    }

    public String getCampoLogin() {
        return campoLogin.getText();
    }

    public void setCampoLogin(String campoLogin) {
        this.campoLogin.setText(campoLogin);
    }



    public JanelaLogin() {
        initComponents();
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        PainelPrincipal = new javax.swing.JPanel();
        PainelBotoes = new javax.swing.JPanel();
        Senha = new javax.swing.JLabel();
        CampoSenha = new javax.swing.JPasswordField();
        botaoEntrar = new javax.swing.JButton();
        botaoCadastrar = new javax.swing.JButton();
        EsquecerSenha = new javax.swing.JLabel();
        AlterarSenha = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        campoCpf = new javax.swing.JFormattedTextField();
        campoSenhaNaoCadastrado = new javax.swing.JPasswordField();
        campoLoginNaoCadastrado = new javax.swing.JTextField();
        campoLogin = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Tela Inicial");

        PainelPrincipal.setBackground(new java.awt.Color(255, 255, 255));
        PainelPrincipal.setPreferredSize(new java.awt.Dimension(838, 290));
        PainelPrincipal.setRequestFocusEnabled(false);

        PainelBotoes.setBackground(new java.awt.Color(255, 255, 255));

        Senha.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        Senha.setText("Login");

        botaoEntrar.setText("Entrar");
        botaoEntrar.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0, 51, 204), null));

        botaoCadastrar.setBackground(new java.awt.Color(204, 204, 204));
        botaoCadastrar.setText("Cadastrar");
        botaoCadastrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        EsquecerSenha.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        EsquecerSenha.setForeground(new java.awt.Color(204, 0, 0));
        EsquecerSenha.setText("Esqueceu a senha?");

        AlterarSenha.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        AlterarSenha.setForeground(new java.awt.Color(204, 0, 0));
        AlterarSenha.setText("Alterar senha");

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel1.setText("Se ainda não se cadastrou cadastre-se");

        jLabel2.setText("Cpf");

        jLabel3.setText("Login");

        jLabel4.setText("Senha");

        try {
            campoCpf.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel6.setText("Senha");

        javax.swing.GroupLayout PainelBotoesLayout = new javax.swing.GroupLayout(PainelBotoes);
        PainelBotoes.setLayout(PainelBotoesLayout);
        PainelBotoesLayout.setHorizontalGroup(
            PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PainelBotoesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PainelBotoesLayout.createSequentialGroup()
                        .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(PainelBotoesLayout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addGap(18, 18, 18)
                                .addComponent(CampoSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(PainelBotoesLayout.createSequentialGroup()
                                        .addComponent(Senha)
                                        .addGap(18, 18, 18)
                                        .addComponent(campoLogin, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE))
                                    .addGroup(PainelBotoesLayout.createSequentialGroup()
                                        .addGap(17, 17, 17)
                                        .addComponent(botaoEntrar, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addComponent(EsquecerSenha)))
                        .addGap(85, 85, 85))
                    .addGroup(PainelBotoesLayout.createSequentialGroup()
                        .addComponent(AlterarSenha)
                        .addGap(255, 255, 255)))
                .addGap(302, 302, 302)
                .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(PainelBotoesLayout.createSequentialGroup()
                            .addComponent(jLabel4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(campoSenhaNaoCadastrado))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, PainelBotoesLayout.createSequentialGroup()
                            .addComponent(jLabel3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(campoLoginNaoCadastrado))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, PainelBotoesLayout.createSequentialGroup()
                            .addComponent(jLabel2)
                            .addGap(18, 18, 18)
                            .addComponent(campoCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(botaoCadastrar))
                .addContainerGap())
        );
        PainelBotoesLayout.setVerticalGroup(
            PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PainelBotoesLayout.createSequentialGroup()
                .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PainelBotoesLayout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(Senha)
                            .addComponent(campoLogin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(CampoSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addGap(30, 30, 30)
                        .addComponent(botaoEntrar, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(EsquecerSenha)
                        .addGap(18, 18, 18)
                        .addComponent(AlterarSenha))
                    .addGroup(PainelBotoesLayout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(campoCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(campoLoginNaoCadastrado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PainelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(campoSenhaNaoCadastrado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botaoCadastrar)
                        .addGap(19, 19, 19)))
                .addContainerGap())
        );

        jLabel5.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel5.setForeground(new java.awt.Color(255, 255, 255));

        javax.swing.GroupLayout PainelPrincipalLayout = new javax.swing.GroupLayout(PainelPrincipal);
        PainelPrincipal.setLayout(PainelPrincipalLayout);
        PainelPrincipalLayout.setHorizontalGroup(
            PainelPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PainelPrincipalLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PainelPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(PainelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 514, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        PainelPrincipalLayout.setVerticalGroup(
            PainelPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PainelPrincipalLayout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addComponent(PainelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addContainerGap(35, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(PainelPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 938, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(PainelPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

  
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel AlterarSenha;
    private javax.swing.JPasswordField CampoSenha;
    private javax.swing.JLabel EsquecerSenha;
    private javax.swing.JPanel PainelBotoes;
    private javax.swing.JPanel PainelPrincipal;
    private javax.swing.JLabel Senha;
    private javax.swing.JButton botaoCadastrar;
    private javax.swing.JButton botaoEntrar;
    private javax.swing.JFormattedTextField campoCpf;
    private javax.swing.JTextField campoLogin;
    private javax.swing.JTextField campoLoginNaoCadastrado;
    private javax.swing.JPasswordField campoSenhaNaoCadastrado;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    // End of variables declaration//GEN-END:variables

}
